package com.example.administrator.a0017activityintenttovalue;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    //点击传值
    public void send(View v){

        //传递参数
        Intent intent = new Intent(MainActivity.this,Main2Activity.class);
        intent.putExtra("id",123);
        intent.putExtra("title","哈哈哈哈");
        startActivity(intent);
    }

    //使用bundle传值
    public void sendBundle(View v){
        Toast.makeText(MainActivity.this,"sendbundle",Toast.LENGTH_LONG);
    }
}
